package org.ezplatform.office.meeting.info.dao;

import java.util.List;

import org.ezplatform.core.dao.jpa.JpaBaseDao;
import org.ezplatform.office.meeting.info.entity.SignedInfo;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

@Repository
public interface SignedInfoDao extends JpaBaseDao<SignedInfo, String> {
	
	@Modifying
    @Query(value = "delete from SignedInfo s where s.applyRecordId in (?1)")
    int delByRecordId(String... recordIds);
	
	@Query(value = "from SignedInfo s where s.signedUserId=?1 and s.applyRecordId=?2")
    List<SignedInfo> getSignedInfoList(String userId, String applyRecordId);
	
	@Modifying
    @Query(value = "delete from SignedInfo s where s.signedUserId in (?1) and s.applyRecordId=?2 and s.corpId=?3")
    void deleteSignedInfo(List<String> signedInfoUserIdList, String applyRecordId, String corpId);
	
	@Modifying
    @Query(value = "delete from SignedInfo s where s.applyRecordId=?1 and s.corpId=?2")
    void deleteSignedInfoByApplyrecordId(String applyRecordId, String corpId);
}